//package max;
//import MAE.mae.*;
//import MAI.mai.*;

package MAX;

import IAA.*;
import mae.*;

import java.io.*;
import java.util.*;

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.border.*; // @cory
import javax.swing.table.TableColumn;
import javax.swing.table.DefaultTableModel;



public class MetaGui extends JPanel implements ActionListener
{
	static JFrame frampy;
	
	public MetaGui()
	{
		super(new GridLayout(3, 1));
		JLabel label = new JLabel("DUCKLINGS");
		JButton launch1 = new JButton("Launch AgreeGUI");
		launch1.addActionListener(this);
		launch1.setActionCommand("Agreement!");
		JButton launch2 = new JButton("Launch MAE");
		launch2.addActionListener(this);
		launch2.setActionCommand("Annotation!");
		add(label);
		add(launch2);
		add(launch1);
	}
	
	public void actionPerformed(ActionEvent e)
	{
		JPanel newPanel;
		switch(e.getActionCommand())
		{
			case "Agreement!": newPanel = new AgreeGui();
				break;
			case "Annotation!": newPanel = new MaeGui();
				break;
		}
		this.setVisible(false);
		frampy.remove(this);
		frampy.setContentPane(newPanel);
		newPanel.setVisible(true);
	}

	private static void createAndShowGUI()
	{
		frampy = new JFrame("MAX");
		frampy.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JComponent mg = new MetaGui();
		mg.setOpaque(true);
		frampy.setContentPane(mg);
		
		frampy.pack();
		frampy.setSize(450, 250);
		frampy.setVisible(true);
	}
	
	public static void main(String[] args)
	{
		javax.swing.SwingUtilities.invokeLater
		(
			new Runnable() 
			{
				public void run() 
				{
					createAndShowGUI();
				}
			}
		);
	}
}



